<template>
  <div>
    <div class="dashboard-container">
      
      <div class="big-back-box">
        <div class="top" style="margin-bottom: 20px">服务商注册</div>
        <!-- 卡片 -->
        <div style="width: 600px; margin: 0 auto">
          <el-form ref="form" :model="form" label-width="100px">
            <el-form-item label="用户名">
              <el-input v-model="form.username" :disabled="false"></el-input>
            </el-form-item>
            <el-form-item label="密码">
              <el-input v-model="form.password" show-password></el-input>
            </el-form-item>
            <el-form-item label="企业名称">
              <el-input
                v-model="form.enterpriseName"
                :disabled="false"
              ></el-input>
            </el-form-item>
      
            <el-form-item label="公司性质">
              <el-input
                v-model="form.companyNature"
                :disabled="false"
              ></el-input>
            </el-form-item>
            <el-form-item label="成立日期">
                <el-date-picker v-model="form.establishmentDate" style="width: 40%" ></el-date-picker>
            </el-form-item>
            <el-form-item label="注册地点">
              <el-input
                v-model="form.registrationPlace"
                :disabled="false"
              ></el-input>
            </el-form-item>

            <el-form-item label="办公地点">
              <el-input
                v-model="form.officeLocation"
                :disabled="false"
              ></el-input>
            </el-form-item>
 
            <el-form-item label="注册资本">
              <el-input
                v-model="form.registeredCapital"
                :disabled="false"
              ></el-input>
            </el-form-item>
            <!--  -->
            <el-form-item label="投资金额">
              <el-input
                v-model="form.investmentAmount"
                :disabled="false"
              ></el-input>
            </el-form-item>
            <!--  -->
            <el-form-item label="股东">
              <el-input v-model="form.shareholder" :disabled="false"></el-input>
            </el-form-item>
            <!--  -->
            <el-form-item label="董事">
              <el-input v-model="form.director" :disabled="false"></el-input>
            </el-form-item>
            <!--  -->
            <el-form-item label="监事">
              <el-input v-model="form.supervisor" :disabled="false"></el-input>
            </el-form-item>
            <!--  -->
            <el-form-item label="经理">
              <el-input v-model="form.manager" :disabled="false"></el-input>
            </el-form-item>
            <!--  -->
            <el-form-item label="分支机构">
              <el-input
                v-model="form.branchOffice"
                :disabled="false"
              ></el-input>
            </el-form-item>
        
            <!-- 按钮 -->
            <el-form-item>
              <router-link to="/login">
                <el-button type="primary" @click="onSubmit">注册</el-button>
              </router-link>
              <router-link to="/dashboard">
                <el-button style="margin-left:20px">取消</el-button>
              </router-link>             
            </el-form-item>
          </el-form>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {registerServiceProvider} from '@/api/user'
export default {
  data() {
    return {
      form: {
        username: "",
        password: "",
        enterpriseName: "",
        companyNature: "",
        establishmentDate: "",
        registrationPlace: "",
        officeLocation: "",
        registeredCapital: 0,
        investmentAmount: 0,
        shareholder: "",
        director: "",
        supervisor: "",
        manager: "",
        branchOffice: "",
      },
    };
  },
  methods: {
    onSubmit() {
  
        registerServiceProvider(this.form).then(resp=>{
        console.log(resp);
   
        this.$message(resp.data.message);
      })
    },
  },
};
</script>

<style lang="scss" scoped>
// 页头LOGO
.top {
  height: 50px;
  margin: auto;
  font-size: 30px;
  text-align: center;
  line-height: 50px;
}

// 大盒子
.big-back-box {
  width: 1080px;
  margin: 0 auto;
}

// 原框架自带
.dashboard {
  &-container {
    margin-top: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}

// 页脚
.footer {
  height: 300px;
  background-color: blue;
}
.footer-back-box {
  width: 1080px;
  margin-left: 45px;
}
.footer-title {
  height: 30px;
  line-height: 40px;
  padding-left: 10px;
}
.footer-link-card {
  width: 200px;
  background-color: orange;
  margin-left: 10px;
}

// 模板-卡片
.text {
  font-size: 14px;
}
.item {
  padding: 18px 0;
}
.box-card {
  width: 480px;
}
</style>